include("cl_init.lua")
include("shared.lua")
include("interface/userdata.lua")
include("other/npcplayer.lua")
//include("other/setmodelplayer.lua")

AddCSLuaFile("cl_init.lua")
AddCSLuaFile("interface/userdata.lua")
AddCSLuaFile("other/npcplayer.lua")
//AddCSLuaFile("other/setmodelplayer.lua")
AddCSLuaFile("shared.lua")

function GM:Initialize()

	self.BaseClass:Initialize()

end

function GM:InitPostEntity()

	for k,v in pairs( ents.FindByClass("weapon_*") ) do
	
		local newEnt = ents.Create("item_pickup")
		newEnt:SetPos( v:GetPos() )
		newEnt:SetModel( v:GetModel() )
		newEnt:SetKeyValue( "type", v:GetClass() )
		newEnt:Spawn()

		v:Remove()

	end

end

function GM:PlayerInitialSpawn( ply )

	self.BaseClass:PlayerInitialSpawn(ply)
	
	local camera = ents.Create("side_camera");
	camera:Spawn();
	camera:GetTable():SetPlayer( ply );

	ply:GetTable().Camera = camera;	
	ply:SetViewEntity(camera)

end

function GM:PlayerDisconnected(ply)

	self.BaseClass:PlayerDisconnected(ply)
	
	ply:SetViewEntity(ply)
	ply:GetTable().Camera:Remove()
	ply:GetTable().Camera = nil
	
end

function GM:SetupMove(ply, mv)

	self.BaseClass:SetupMove(ply, mv)

	//local vel = mv:GetVelocity()
	//vel.y = 0;
	//mv:SetVelocity(vel)
	
	local ang = mv:GetMoveAngles()
	if (ang.yaw != 0 and ang.yaw != 180) then
		ang.yaw = 0
	end
	//mv:SetMoveAngles(ang)
	
	//mv:SetSideSpeed(0)

end

 function GM:PlayerSpawn(ply)
 //util.PrecacheModel("models/combine_strider.mdl")
 util.PrecacheModel("models/Humans/Group01/male_02.mdl")
 ply:SetModel("models/Humans/Group01/male_02.mdl")
 //ply:SetModel("models/combine_strider.mdl")


 end
